

public class max {
    public static void main(String[] args) {
        int[] arr={1,2,5,9,7};
        int max=get_max(arr);
        System.out.println(max);
    }


    public static int get_max(int []arr) {
        int max = arr[0];
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] > max) {
                max = arr[i];
            }
        }

        return max;

    }}
